package com.naiterui.ehp.bp.bo.groupConsult;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

import static com.naiterui.ehp.bp.bo.groupConsult.GroupConsultSignParamBO.OPTION_TYPE_TARGET;

/**
 * @author gaoliangliang
 * @date 2022/8/3
 * @since 0.0.1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GroupConsultPreSignParamBO {

    private int opinionType;

    private Long groupConsultId;
    private Long patientId;
    private Long inquirerId;
    private String name;
    private Integer gender;
    private String departmentName;
    private String age;

    /**
     * 会诊原由
     */
    private String groupConsultReason;

    /**
     * 受邀方 会诊意见
     */
    private String targetOpinion;

    /**
     * 受邀方 会诊意见填写时间
     */
    private Date targetOpinionAt;

    /**
     * 发起方 会诊意见
     */
    private String sourceOpinion;

    /**
     * 发起方 会诊意见填写时间
     */
    private Date sourceOpinionAt;

    /**
     * 发起方 医生名称
     */
    private String sourceDoctorName;

    /**
     * 发起方 医生ID
     */
    private Long sourceDoctorId;

    /**
     * 受邀方医院名称
     */
    private String targetHospitalName;

    /**
     * 受邀方医院ID
     */
    private Integer targetHospitalId;

    /**
     * 受邀方医生名称
     */
    private String targetDoctorName;

    /**
     * 受邀方医生ID
     */
    private Long targetDoctorId;

    /**
     * 诊断
     */
    private List<String> diagnosis;

    public Long fetchDoctorId() {
        if (OPTION_TYPE_TARGET == this.opinionType) {
            return this.targetDoctorId;
        }
        return this.sourceDoctorId;
    }
}
